/**
 *
 */
package com.bsoft.gol.hbs.dao;

import ctd.persistence.annotation.DAOMethod;
import ctd.persistence.annotation.DAOParam;
import ctd.spring.boot.annotation.SsdevDao;
import ctd.util.annotation.RpcService;
import hc.message.entity.MsgNotifyMode;
import java.util.List;

/**
 * 
 * @since 2018-03-05 01:58:37
 */
@SsdevDao(serviceId = "msgNotifyModeService")
public abstract class MsgNotifyModeDAO extends ctd.persistence.support.hibernate.HibernateSupportDelegateDAO<MsgNotifyMode> {

    public MsgNotifyModeDAO() {
        this.setKeyField("id");
    }

    @DAOMethod(sql = "from MsgNotifyMode where id=:id")
    @RpcService
    public abstract MsgNotifyMode getMsgNotifyModeById(@DAOParam("id") String id);

    @DAOMethod(sql = "from MsgNotifyMode")
    @RpcService
    public abstract List<MsgNotifyMode> findMsgNotifyModes();

    @DAOMethod(sql = "from MsgNotifyMode where cfgId = :cfgId")
    @RpcService
    public abstract List<MsgNotifyMode> findByCfgId(@DAOParam("cfgId")Integer cfgId);

    @DAOMethod(sql = "update MsgNotifyMode set status = :status where id = :id")
    @RpcService
    public abstract void updateNotifyModeStatus(@DAOParam("status")byte status, @DAOParam("id")Integer id);

    @DAOMethod(sql = "select count(1) from MsgNotifyMode where cfgId = :cfgId and status = :status")
    @RpcService
    public abstract Long getNotifyModeByCfgIdCount(@DAOParam("cfgId")Integer cfgId, @DAOParam("status")byte status);

    @RpcService
    public void saveMsgNotifyMode(MsgNotifyMode msgNotifyMode){
        this.save(msgNotifyMode);
    }

    @RpcService
    public void updateMsgNotifyMode(MsgNotifyMode msgNotifyMode){
        this.update(msgNotifyMode);
    }
    @RpcService
    public void deleteMsgNotifyMode(Integer msgNotifyModeId){
        this.remove(msgNotifyModeId);
    }
}